package com.boat.sample.ddd.infrastructure.config;

import java.util.Arrays;
import java.util.List;

import org.springframework.boot.web.servlet.error.ErrorAttributes;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

import com.boat.framework.base.exception.CommonErrorCode;
import com.boat.framework.base.exception.ServiceException;
import com.boat.starter.web.excepton.PageNoFindExceptonHandler;

import cn.dev33.satoken.interceptor.SaInterceptor;
import cn.dev33.satoken.stp.StpUtil;
import lombok.extern.slf4j.Slf4j;

/**
 * 启动配置
 * @author 周江
 *
 */
@Slf4j
@Configuration
public class WebAutoConfiguration {
	/**
	 * 404错误处理。受starter加载顺序限制，此对象需要在业务系统显示集成
	 * @param errorAttributes
	 * @return
	 */
	@Bean
	public PageNoFindExceptonHandler pageNoFindExceptonHandler(ErrorAttributes errorAttributes) {
		return new PageNoFindExceptonHandler(errorAttributes);
	}
}